package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StemealDishMapper {
    /*
    * 根据菜品id查询套餐id
    * */
    @Select("select * from setmeal_dish where id = #{id}")
    List<SetmealDish> getSetmealIdsByDishId(Long id);


    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    @AutoFill(OperationType.INSERT)
    void insertStemealDishes(List<SetmealDish> setmealDishes);

    void deleteStemealDishes(@Param("setmealIds") List<Long> setmealIds);
}
